﻿

namespace HSS.Xaml.UI.Controls
{
	/// <summary>
	/// The interface that represents a property grid item.
	/// </summary>
	public interface IPropertyGridItem
	{
		/// <summary>
		/// Called when the property grid has been unloaded or requesting this item to clean up it's state.
		/// </summary>
		void OnRemoved();
		/// <summary>
		/// Gets or sets the Instance object
		/// </summary>
		object Instance { get; }
		/// <summary>
		/// Gets the Category of this entry
		/// </summary>
		string Category { get; }
		/// <summary>
		/// Gets the DisplayName of this entry
		/// </summary>
		string DisplayName { get; }
		/// <summary>
		/// Gets the Name of this entry
		/// </summary>
		string Name { get; }
		/// <summary>
		/// Gets the Description of this entry
		/// </summary>
		string Description { get; }
		/// <summary>
		/// Gets or sets whether this Entry is selected
		/// </summary>
		bool IsSelected { get; }
		/// <summary>
		/// Get if this Entry is visible or collapsed
		/// </summary>
		bool IsVisible { get; set; }
		/// <summary>
		/// Gets or sets if this Entry is active
		/// </summary>
		bool IsActive { get; }
		/// <summary>
		/// Get if this Entry's editor is focused regardless if the editor is in edit mode or readonly mode
		/// </summary>
		bool IsEditorFocused { get; }
		/// <summary>
		/// Gets the ordinal index of this editor within the property grid.
		/// </summary>
		int RowIndex { get; set; }
		/// <summary>
		/// Activate this item
		/// </summary>
		void Activate();
		/// <summary>
		/// Select this item
		/// </summary>
		[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Select")]
		void Select();
		/// <summary>
		/// Get the current value from the Property Descriptor.
		/// </summary>
		void Refresh();
		/// <summary>
		/// Select this item, activate the Editor and Execute the default action for the Editor
		/// </summary>
		void ExecuteDefaultAction();
		/// <summary>
		/// Deselect this item
		/// </summary>
		void Deselect();
	}
}